<template>
	<view class="main">
		<view class="about_tit t22">{{title}}</view>
		<view class="about_info t22">{{cont}}</view>
		<view class="about_date t8">{{time}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				title: '',
				time: '',
				cont: ''
			}
		},
		onLoad(options) {
			console.log(options)
			this.id = options.id;
			this.message();
		},
		methods: {
			message() {
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded', //自定义请求头信息
					},
					url: getApp().globalData.url + 'article/activityList', //仅为示例，并非真实接口地址。
					method: 'POST',
					data: {
						// id: this.id
					},
					success: (res) => {
						uni.hideLoading(); //关闭加载动画
						console.log(res);
						if (res.data.status == '200') {
							for (var i in res.data.data) {
								if (this.id == res.data.data[i].id) {
									this.title = res.data.data[i].title;
									this.cont = res.data.data[i].content;
									this.time = res.data.data[i].createdTime;

								}
							}
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: 'none',
								duration: 2000
							});
						}
					},
					fail: (error) => {
						uni.hideLoading();
						uni.showToast({
							title: error,
							icon: 'none',
							duration: 2000
						});
						console.log(error)
					}
				});
			},
		}
	}
</script>

<style>
	.about_tit {
		width: 100%;
		height: auto;
		display: block;
		float: left;
		line-height: 8vw;
		padding: 3vw 0;
		margin-bottom: 2vw;
		border-bottom: 1px solid #ddd;
	}

	.about_info {
		width: 100%;
		height: auto;
		display: block;
		float: left;
		padding: 3vw 0;
		line-height: 7vw;
	}

	.about_date {
		width: 100%;
		height: auto;
		display: block;
		float: left;
		text-align: right;
		margin-bottom: 4vw;
	}
</style>
